#include "ExcelDataManager.h"

#include <list>
#include <set>
#include <tinyxml/tinyxml.h>
#include "../Base/Logger.h"

int main()
{
	char * p= new char;
	return 0;
	Logger & rLogger = Logger::GetInstance("DataTool");
	LOG_INFO(rLogger, "Begin running the DataTool.");
	CExcelDataInfoManager EDIM;

	std::set< std::string > fileSet;
	TiXmlDocument doc("StaticData/StaticTableMap.xml");
	if (doc.LoadFile())
	{
		TiXmlNode * pTableMapNode = doc.FirstChild("TableMap");
		if (pTableMapNode)
		{
			TiXmlElement * pItemE = pTableMapNode->FirstChildElement("Item");
			for(; pItemE; pItemE = pItemE->NextSiblingElement("Item"))
			{
				std::string strFileName = pItemE->Attribute("FileName");
				fileSet.insert(pItemE->Attribute("FileName"));
			}
		}
		else
		{
			LOG_WARN(rLogger, "There is something wrong with the file of StaticData/StaticTableMap.xml");
		}
	}
	else
	{
		LOG_ERROR(rLogger, "Load StaticData/StaticTableMap.xml Failed.");
	}
	std::set< std::string >::iterator it = fileSet.begin();
	for (; it!=fileSet.end(); ++it)
	{
		if (EDIM.TransferExcelFile(*it))
		{
			LOG_INFO(rLogger, "Transfer the excel file of " << *it << " Success.");
		}
		else
		{
			LOG_WARN(rLogger, "Transfer the excel file of " << *it << " Failed.");
		}
	}
	//CExcelDataInfoManager EDIM;
	//EDIM.TransferExcelFile("ItemList.xls");
	//EDIM.TransferExcelFile("ItemList2.xls");
	//EDIM.TransferExcelFile("ItemList3.xls");
	//EDIM.TransferExcelFile("XXXX.xls");
	return 0;
}
